﻿

@{
    var searchTerm = "";
    
    if(  ViewBag.SearchTerm != null )
    {
        searchTerm = ViewBag.SearchTerm;
    }
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
     
    @{ Html.RenderPartial("GoogleFonts"); }
    @Styles.Render("~/public/css")     
    @RenderSection("CssHeader", required: false)
    
    <script type="text/javascript">
        var KB_SearchUrl = "@Url.Action("Ajax","Search")";
    </script>
    
</head>
<body>
                 
    <div class="navbar navbar-default" role="navigation">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">@UIResources.MainMenuBootstrapToogleTitle</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="@Url.Action("Index","Home")">@ViewBag.CompanyName</a>
        </div>
        <div class="navbar-collapse collapse">   
            <ul class="nav navbar-nav">  
                @KBVaultHelperFunctions.CreateBootstrapCategoryMenu()
             </ul>      
        </div>
    </div>        
    <div class="container">
        <div class="row">
            @*
            <div class="col-lg-12 page-header">            
                <h1>
                    @ViewBag.CompanyName
                    <small>@ViewBag.TagLine</small>
                </h1>    
                <p runat="server" id="htmlJumbotronText" class="lead">@ViewBag.JumbotronText</p>            
            </div>        
            *@
            
            @using (Html.BeginForm("Do", "Search", FormMethod.Post, new { id = "SearchForm" }))
            {
                <div class="input-group">       
                    <input type="hidden" name="ArticleId" id="ArticleId" value="" />
                    <input type="text" class="form-control search-control" name="SearchKeyword" placeholder="Enter search text" ID="txtSearch" value="@searchTerm" />
                        <span class="input-group-btn">
                            <input type="submit" id="btnDoSearch" class="btn btn-default" value="Search" />
                        </span>
                </div>             
            }    
            
        </div>

        <br />
        @RenderBody()   
       
    </div>
    <div id="footer">
        Built by KbVault
    </div>
        
    @Scripts.Render("~/public/js")
    @RenderSection("scripts", required: false)
    
    @if( !String.IsNullOrEmpty(ViewBag.AnalyticsAccount) )
    {
        <script>
            (function (i, s, o, g, r, a, m) {
                i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
                    (i[r].q = i[r].q || []).push(arguments)
                }, i[r].l = 1 * new Date(); a = s.createElement(o),
                m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
            })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');

            ga('create', '@ViewBag.AnalyticsAccount', 'auto');
            ga('send', 'pageview');
        </script>
    }
    
</body>
</html>
